CAN Gateway code example  v1.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Functions | Variables
main.cpp File Reference

The main file of an example code for CAN Gateway with hdj2534.so (v1.0.226) More...

#include <iostream>
#include <cstring>
#include <unistd.h>
#include <pthread.h>
#include <hdj2534.h>
#include "cangw.hpp"

Go to the source code of this file.

Functions

static void rcvChannel1 (const J2534::PASSTHRU_MSG *rxPassThruMsg, unsigned long rxMsgNum)
 Callback function for receive on channel 1. More...
 
static void rcvChannel2 (const J2534::PASSTHRU_MSG *rxPassThruMsg, unsigned long rxMsgNum)
 Callback function for receive on channel 2. More...
 
int main ()
 The main function.
 

Variables

static const unsigned int MESSAGES_TO_SEND = 50
 Number of messages to send.
 
static const unsigned int PERIODIC_MSG_INTERVAL = 50
 Period for periodic messages.
 
static const char CHANNEL_1_MARK = '1'
 Marking for messages sent over channel 1.
 
static const char CHANNEL_2_MARK = '2'
 Marking for messages sent over channel 2.
 
static const char PERIODIC_MSG_MARK = 'P'
 Marking for periodic messages.
 
static pthread_mutex_t screenMutex = PTHREAD_MUTEX_INITIALIZER
 Mutex used by callback functions during accessing the screen.
 

Detailed Description

The main file of an example code for CAN Gateway with hdj2534.so (v1.0.226)

Date
2014-03-06

Definition in file main.cpp.

Function Documentation

static void rcvChannel1 ( const J2534::PASSTHRU_MSG *  rxPassThruMsg,
unsigned long  rxMsgNum 
)
static

Callback function for receive on channel 1.

Parameters
[in]rxPassThruMsgPointer to buffer with received messages
[in]rxMsgNumNumber of received messages

Definition at line 157 of file main.cpp.

References PERIODIC_MSG_MARK, and screenMutex.

Referenced by main().

static void rcvChannel2 ( const J2534::PASSTHRU_MSG *  rxPassThruMsg,
unsigned long  rxMsgNum 
)
static

Callback function for receive on channel 2.

Parameters
[in]rxPassThruMsgPointer to buffer with received messages
[in]rxMsgNumNumber of received messages

Definition at line 182 of file main.cpp.

References PERIODIC_MSG_MARK, and screenMutex.

Referenced by main().